<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>

<body>
  <script>
    // 利用箭头函数来求和
    let num = (...arr)=>{
      let i = 0
      for(let sum = 0;sum < arr.length;sum++){
      i += arr[sum]
      }
      return i
    }
  num(2,3)
    console.log(num(2,3))
  </script>
</body>

</html>